{{include file="user/u_header.html"}}
<div class="w998 u_main clear">
	{{include file="user/u_leftMenu.html"}}	
    <!--右侧开始-->
    <div class="Fr right">
    实名认证  <br/>
    <form id="form1" name="form1" method="post" action="user.php?ctl=safe&act=realverify">
        姓名: <input type="text" name="realname" /><br />
        身份证号: <input type="text" name="idcard" /><br />
        身份证正面(手持):
            <img id="idcrad1" width="100" height="100" style="border: 1px solid #ccc;" src="">
            <input type="file" id="image_file" name="image_file[]" size="35" style="display:none">
            <input type="hidden" id="idcrad_url" name="idcrad_url">
            <input name="btnupload" type="button" attr="idcrad1" id="btnupload1" value="上传">
           <br />
        身份证反面照片: 
            <img id="idcrad2" width="100" height="100" style="border: 1px solid #ccc;" src="">
            <input type="file" id="image_file2" name="image_file[]" size="35" style="display:none">
            <input type="hidden" id="idcrad_url_back" name="idcrad_url_back">
            <input name="btnupload" type="button" attr="idcrad2" id="btnupload2" value="上传">
        <br />
        <input type="submit" name="btnsubmit">
    </form>
    </div>
    <!--右侧结束-->
</div>
<script type="text/javascript" src="res/js/ajaxupload.js"></script>
<script type="text/javascript">
$(function(){ 
    var button = $('#btnupload1');
    new AjaxUpload(button, {
      action: "user.php?{{$TIN_CTL}}=ajaxupload&{{$TIN_ACT}}=UploadImg",
      name: 'image_file[]',
      onSubmit : function(image_file, ext){
          this.disable();
          $.jBox.tip('图片上传中，请稍后..', 'loading');
      },
      onComplete: function(image_file, response){
          this.enable();
          var jsonObj = eval("("+response+")"); 
          if(jsonObj.code=="success"){
            $("#idcrad1").attr("src", "{{$smarty.const.TIN_MEDIA_URL}}"+jsonObj.data.name);
            $("#idcrad_url").val("{{$smarty.const.TIN_MEDIA_URL}}"+jsonObj.data.name);
            $.jBox.tip("上传成功");
          }else{
              $.jBox.tip(jsonObj.msg);
              return false;
          }
     }
   });
    var button = $('#btnupload2');
    new AjaxUpload(button, {
      action: "user.php?{{$TIN_CTL}}=ajaxupload&{{$TIN_ACT}}=UploadImg",
      name: 'image_file[]',
      onSubmit : function(image_file, ext){
          this.disable();
          $.jBox.tip('图片上传中，请稍后..', 'loading');
      },
      onComplete: function(image_file, response){
          this.enable();
          var jsonObj = eval("("+response+")"); 
          if(jsonObj.code=="success"){
            $("#idcrad2").attr("src", "{{$smarty.const.TIN_MEDIA_URL}}"+jsonObj.data.name);
            $("#idcrad_url_back").val("{{$smarty.const.TIN_MEDIA_URL}}"+jsonObj.data.name);
            $.jBox.tip("上传成功");
          }else{
              $.jBox.tip(jsonObj.msg);
              return false;
          }
     }
   });
});
</script>
{{include file="user/u_footer.html"}}
